package cn.math.appmath.filter;

import java.io.IOException; 

import javax.servlet.FilterChain; 
import javax.servlet.ServletException; 
import javax.servlet.ServletRequest; 
import javax.servlet.ServletResponse; 

import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter; 

public class MyFilter extends StrutsPrepareAndExecuteFilter { 
  public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { 
	  req.setCharacterEncoding("utf-8"); 
	  resp.setCharacterEncoding("utf-8"); 
	  super.doFilter(req, resp, chain); 
  } 
} 